package com.boarsoft.boar.batch.demo;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.boarsoft.boar.batch.demo.biz.Coredpfm02Biz;
import com.boarsoft.boar.batch.demo.entity.Coredpfm02;
import com.boarsoft.message.bean.Message;
import com.boarsoft.message.core.MessageService;

@Component("dpfm02MsgSvc")
public class Dpfm02MsgSvc implements MessageService {
	@Autowired
	protected Coredpfm02Biz coredpfm02Biz;

	// @Autowired
	// protected SimpleDao dao;
//	@Autowired
//	@Qualifier("datasource")
//	protected DataSource dataSource;

	@SuppressWarnings("unchecked")
	@Override
	public void put(Message msg) throws Exception {
		List<Coredpfm02> lt = (List<Coredpfm02>) msg.getContent();
		coredpfm02Biz.batchSave((int) msg.getAttachment(), lt);
		// lt.clear();
		// this.save((int) msg.getAttachment(), lt);
	}
}
